/*
 * GameState.h
 *
 *  Created on: Jul 13, 2009
 *      Author: scott
 */

#include "Camera.h"

#ifndef GAMESTATE_H_
#define GAMESTATE_H_

class GameState {
protected:
	SceneGraphNode * root;
	Camera * camera;
	static GameState * state;
public:

	static GameState * getState()
	{
		return state;
	}

	static void switchTo(GameState* gameState)
	{
		// switch to a new game state
		state->switchFrom();
		state = gameState;
		state->switchTo();
	}

	GameState();
	virtual ~GameState();

	virtual void update() = 0;

	virtual void switchTo() = 0;
	virtual void switchFrom() = 0;

    Camera *getCamera() const
    {
        return camera;
    }

    SceneGraphNode *getRoot() const
    {
        return root;
    }

    void setCamera(Camera *camera)
    {
        this->camera = camera;
    }

    void setRoot(SceneGraphNode *root)
    {
        this->root = root;
    }

};

#endif /* GAMESTATE_H_ */
